return "Pops up a slider to set the system volume." & RETURN & "PARAMETERS:" & RETURN & "ΓÇó VideoSprite - set the volume of sprite VideoSprite." & RETURN & "ΓÇó Down Member - the picture of the button when pressed." & RETURN & "ΓÇó Slider Background Sprite - the slider background sprite." & RETURN & "ΓÇó Bounding Box Sprite - the bounding box sprite, make invisible rect." & RETURN & "ΓÇó Slider Knob Sprite - the slider knob sprite."
end
on getAssocMembers
set myPropList to [downState]
return myPropList
end
on beginSprite me
puppetSprite(the spriteNum of me, 0)
puppetSprite(background, 0)
puppetSprite(boundingsprite, 0)
puppetSprite(Slider, 0)
set upstate to the member of sprite the spriteNum of me
end
on mouseDown me
puppetSprite(the spriteNum of me, 1)
puppetSprite(background, 1)
puppetSprite(boundingsprite, 1)
puppetSprite(Slider, 1)
set the member of sprite the spriteNum of me to member downState
set soundRangeCast to the number of member the castNum of sprite boundingsprite
set soundHeight to the height of cast soundRangeCast
set the loc of sprite background to point((the left of sprite boundingsprite + the right of sprite boundingsprite) / 2, (the top of sprite boundingsprite + the bottom of sprite boundingsprite) / 2)
set the loc of sprite Slider to the loc of sprite boundingsprite
set gOutLevel to 255 - the volume of sprite Slider
set the locV of sprite Slider to (gOutLevel * (float(soundHeight) / 255.0)) + the top of sprite boundingsprite
updateStage()
set the constraint of sprite Slider to boundingsprite
repeat while the stillDown
if rollOver(background) then
set the locV of sprite Slider to the mouseV
set gOutLevel to (the mouseV - the top of sprite boundingsprite + 1) / (float(soundHeight) / 255.0)
updateStage()
end if
end repeat
set the member of sprite the spriteNum of me to upstate
updateStage()
if gOutLevel < 0 then
set gOutLevel to 0
end if
if gOutLevel > 240 then
set gOutLevel to 255
end if
set the volume of sprite VideoSprite to 255 - gOutLevel
set the loc of sprite background to point(1000, 1000)
set the loc of sprite boundingsprite to point(1000, 1000)